home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / blrmu13.zip / FF.ASM < prev    next >
Assembly Source File  |  1989-05-06  |  2KB  |  71 lines

  1. page ,132
  2. title ff ( form feed ) as of 05/06/89 - 12:30 pm
  3. ;*-------------------------------------------------
  4. ;
  5. ;        Form Feed
  6. ;
  7. ;        does from 1 to 3 FF's
  8. ;
  9. ;        syntax : ff n ( n = 1 - 3 )
  10. ;
  11. ;   error checking:
  12. ;
  13. ;        if n = 1 - 3, then n is ok
  14. ;
  15. ;        if n < 1 or n > 3, then n is set to 1
  16. ;
  17. ;        if no n, then n is set to 1
  18. ;
  19. ;*-------------------------------------------------
  20. code     segment para public 'code'
  21. ;
  22.          assume  cs:code,ds:code,es:code
  23. ;
  24.          org   128
  25. ;
  26. pl       db    0            ; parm len
  27.          db    0            ; space
  28. amt      db    0            ; C R amount
  29. ;
  30.          org   256
  31. ;
  32. ff:
  33. ;
  34.          cmp   pl,0         ; no n ?
  35.          je    ma1          ; if so, make 1
  36. ;
  37.          cld                ; forward
  38.          lea   si,amt       ; ptr to amt
  39.          lodsb              ; put it in al
  40.          and   al,15        ; make ascii binary
  41.          mov   ch,0         ; clear ch
  42.          mov   cl,al        ; mov al to cl
  43. ;
  44. ;        validate amt between 1 - 3
  45. ;
  46.          cmp   cl,1         ; amt = 1 ?
  47.          jl    ma1          ; if LT, make amt 1
  48. ;
  49.          cmp   cl,3         ; amt = 3 ?
  50.          jg    ma1          ; if GT, make amt 1
  51. ;
  52.          jmp   cll          ; ok, do the loop
  53. ;
  54. ma1:     mov   cl,1         ; make amt 1
  55. ;
  56. cll:                        ; cr, lf loop
  57. ;
  58.          mov   dl,12        ; set FF
  59.          mov   ah,5         ; printer output
  60.          int   33           ; DOS F C
  61. ;
  62.          loop  cll          ; n times
  63. ;
  64.          mov   al,0         ; set cond code to 0
  65.          mov   ah,76        ; exit
  66.          int   33           ; DOS F C
  67. ;
  68. code     ends
  69. ;
  70.          end   ff
  71.